
#include "DeviceAnalyzer.h"
#include "Runtime.Low/Services/ServiceBase.h"
#include "Runtime.Low/Devices.h"

using namespace std;
using namespace ttg;
using namespace ttg::services;

//----------------------
//--- DeviceAnalyzer ---
//----------------------

DeviceAnalyzer *DeviceAnalyzer::ref = NULL;

DeviceAnalyzer::DeviceAnalyzer()
	:Service("DeviceAnalyzer", NULL, false)
{
	makeRegistration();
	ttg_internal::devices::RefIniter::check();
}

void DeviceAnalyzer::unRegisterAnalyzer(DeviceInfo *info)
{
	vector<DeviceInfo *> t;
	t.reserve(devices.size());
	for (size_t i = 0; i < devices.size(); i++)
		if (info->getStringName() != devices[i]->getName())
			t.push_back(devices[i]);
	devices = t;
}
